package com.lightkits.wms.domain.deliveryorder;

import com.lightkits.framework.common.model.IResult;
import com.lightkits.framework.soa.hzero.executor.ServiceExecutor;
import com.lightkits.wms.domain.deliveryorder.service.CancelDeliveryDomain;
import com.lightkits.wms.dto.deliveryorder.CancelDeliveryRequestType;
import com.lightkits.wms.dto.deliveryorder.CancelDeliveryResponseType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * CancelDeliveryExecutor
 *
 * @author jing.wei@hand-china.com
 * Created on 2019/2/27 18:37
 */
@Component
public class CancelDeliveryExecutor implements ServiceExecutor<CancelDeliveryRequestType,CancelDeliveryResponseType> {
private final CancelDeliveryDomain cancelDeliveryDomain;

    @Autowired
    public CancelDeliveryExecutor(CancelDeliveryDomain cancelDeliveryDomain) {
        this.cancelDeliveryDomain = cancelDeliveryDomain;
    }

    @Override
    public CancelDeliveryResponseType service(CancelDeliveryRequestType request){
    CancelDeliveryResponseType response=new CancelDeliveryResponseType();
    IResult result=cancelDeliveryDomain.insertValue(request.getCancelDTO());
    result.fill(response);
    return response;
}
}
